package com.yy.service.impl;

import com.yy.dao.UserDao;
import com.yy.pojo.User;
import com.yy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    //UserDao在容器中 直接注入
    @Autowired
    UserDao userDao;

    @Override
    public User login(User user) {
        System.out.println("=====实现登录操作=====");
        return userDao.login(user);
    }

    @Override
    public boolean nicknameExit(String nickname) {
        return userDao.nicknameExist(nickname);
    }

    @Override
    public boolean addUser(User user) {

        return userDao.addUser(user);
    }
}
